﻿<UserControl x:Class="MSDNWebcast.Views.Loading"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" MaxWidth="650" MaxHeight="520">
    <UserControl.Resources>

        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

        <Style x:Key="ProgressBarStyle" TargetType="{x:Type ProgressBar}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ProgressBar}">
                        <Grid>
                            <!-- This Border is the track. It must be named PART_Track -->
                            <Border x:Name="PART_Track" Background="#FF7C7A7A" BorderThickness="0" CornerRadius="2"/>

                            <!-- This Border shows progress. It must be named PART_Indicator for the control to function -->
                            <Border HorizontalAlignment="Left" x:Name="PART_Indicator" BorderThickness="0" CornerRadius="2">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                        <GradientStop Color="#0693c9" Offset="0"/>
                                        <GradientStop Color="GreenYellow" Offset="1"/>
                                        <GradientStop Color="#0693c9" Offset="0.9"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                                <Border.BitmapEffect>
                                    <OuterGlowBitmapEffect GlowColor="White" GlowSize="5" Opacity=".2"/>
                                </Border.BitmapEffect>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Storyboard x:Key="OnLoaded">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="logoPanel" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="txtTitle" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value=".6"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text1" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.3" Value="1" KeySpline="0,0,1,0.2"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.3" Value="1" KeySpline="0.39,0,1,0.23"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.3" Value="1" KeySpline="0.39,0,1,0.23"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text2" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.1" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.4" Value="1" KeySpline="0,0,1,0.2"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.1" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.4" Value="1" KeySpline="0.39,0,1,0.23"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.1" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.4" Value="1" KeySpline="0.39,0,1,0.23"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text3" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.2" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text3" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.2" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text3" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.2" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5" Value="1"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text4" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.1" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.4" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.1" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.4" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.1" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.4" Value="1"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text5" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.1" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text5" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.1" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text5" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.1" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5" Value="1"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text6" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.25" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.45" Value="1" KeySpline="0.39,0,1,0.23"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text6" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.25" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.45" Value="1" KeySpline="0.39,0,1,0.23"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text6" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.25" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.45" Value="1" KeySpline="0.39,0,1,0.23"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text7" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.3" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5" Value="1" KeySpline="0.39,0,1,0.23"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text7" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.3" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5" Value="1" KeySpline="0.39,0,1,0.23"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="text7" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.3" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5" Value="1" KeySpline="0.39,0,1,0.23"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="progressBar" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="1" KeySpline="0,0,1,0.2"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="progressBar" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="1" KeySpline="0.39,0,1,0.23"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="txtLoadingInfo" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.5000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="txtProcessInfo" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.5000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="txtLink" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:02.3000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.7000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="2*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="2*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Image x:Name="logoPanel"  HorizontalAlignment="Center" Height="46" Source="..\Images\logo.png"></Image>
        
        <StackPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" >
            <StackPanel.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Path=LoadingError}" Value="true">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.5" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </StackPanel.Style>
            <TextBlock x:Name="txtTitle"  Foreground="White" TextTrimming="CharacterEllipsis" FontFamily="黑体" Opacity="0" 
			FontSize="28" HorizontalAlignment="Center" FontStretch="ExtraExpanded" TextAlignment="Center" Margin="0" ><Run Text="稍候，马上你就可以顺畅地观看"/><Run Text=" "/><Run FontFamily="Arial" FontSize="30" Text="msdn webcast  "/><LineBreak/><Run Text="中文网络广播"/>
            <TextBlock.BitmapEffect>
			    <OuterGlowBitmapEffect GlowColor="Black" GlowSize="5" Opacity=".5"/>
		    </TextBlock.BitmapEffect>
            </TextBlock>
        </StackPanel>

        <StackPanel x:Name="centerPanel" Margin="0" Grid.Row="4">
            <StackPanel.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Path=LoadingError}" Value="true">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.5" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </StackPanel.Style>
            <Grid Name="panel"  Height="160" TextBlock.Foreground="White">
                <TextBlock Name="text1" HorizontalAlignment="Center" Margin="300,10,0,0" FontSize="20" Opacity="0" RenderTransformOrigin="0.5,0.5" Text="SQL Server">
                    <TextBlock.RenderTransform>
                        <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                    </TextBlock.RenderTransform>
                </TextBlock>
                <TextBlock Name="text2" HorizontalAlignment="Center" Margin="-150,30,0,0" FontSize="20" Opacity="0" RenderTransformOrigin="0.5,0.5" Text="WPF">
                     <TextBlock.RenderTransform>
                        <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                    </TextBlock.RenderTransform>
                </TextBlock>
                <TextBlock Name="text3" HorizontalAlignment="Center" Margin="-330,20,0,0" FontSize="20" Opacity="0" RenderTransformOrigin="0.5,0.5" Text="Visual Studio">
                    <TextBlock.RenderTransform>
                        <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                    </TextBlock.RenderTransform>
                </TextBlock>
                <TextBlock Name="text4" HorizontalAlignment="Center" Margin="360,120,0,0" FontSize="26" Opacity="0" RenderTransformOrigin="0.5,0.5" Text="Windows Phone 7">
                    <TextBlock.RenderTransform>
                        <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                    </TextBlock.RenderTransform>
                </TextBlock>
                <TextBlock Name="text5"  HorizontalAlignment="Center" Margin="60,50,0,0" FontSize="30" Opacity="0" RenderTransformOrigin="0.5,0.5" Text="Silverlight">
                    <TextBlock.RenderTransform>
                        <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                    </TextBlock.RenderTransform>
                </TextBlock>
                <TextBlock Name="text6"  HorizontalAlignment="Center" Margin="-280,90,0,0" FontSize="32" Opacity="0" RenderTransformOrigin="0.5,0.5" Text="ASP.NET">
                    <TextBlock.RenderTransform>
                        <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                    </TextBlock.RenderTransform>
                </TextBlock>
                <TextBlock Name="text7"  HorizontalAlignment="Center" Margin="-60,100,0,0" FontSize="26" Opacity="0" RenderTransformOrigin="0.5,0.5" Text="……">
                    <TextBlock.RenderTransform>
                        <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                    </TextBlock.RenderTransform>
                </TextBlock>
            </Grid>
            <ProgressBar x:Name="progressBar" Margin="0,10,0,0" Maximum="100" Background="Gray"
				Style="{DynamicResource ProgressBarStyle}" RenderTransformOrigin="0.5,0.5" Value="{Binding Path=DownloadProcess}"
				HorizontalAlignment="Stretch" Height="4" Opacity="0">
                <ProgressBar.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </ProgressBar.RenderTransform>
            </ProgressBar>
            <TextBlock x:Name="txtProcessInfo" Margin="0" FontSize="14" TextWrapping="Wrap" Panel.ZIndex="100" Text="{Binding Path=DownloadProcess,StringFormat=\{0\}%}"
				Foreground="White" HorizontalAlignment="Right" Opacity="0">
				<TextBlock.BitmapEffect>
					<OuterGlowBitmapEffect GlowColor="#085594" GlowSize="5" Opacity=".5"/>
				</TextBlock.BitmapEffect>
            </TextBlock>

            <TextBlock x:Name="txtLoadingInfo" HorizontalAlignment="Center" Margin="0,5,0,0" FontFamily="微软雅黑"
				FontSize="14" TextWrapping="Wrap" Text="{Binding Path=ProcessInfo}" Panel.ZIndex="100" Opacity="0">
				<TextBlock.Foreground>
					<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.ActiveBorderColorKey}}"/>
				</TextBlock.Foreground>
				<TextBlock.BitmapEffect>
					<OuterGlowBitmapEffect GlowColor="Black" GlowSize="2" Opacity=".2"/>
				</TextBlock.BitmapEffect>
            </TextBlock>
        </StackPanel>

        <Border x:Name="Border" CornerRadius="4" TextBlock.FontSize="14" TextBlock.LineHeight="18"
			TextBlock.Foreground="White" VerticalAlignment="Bottom" HorizontalAlignment="Center" Grid.Row="6">
            <TextBlock x:Name="txtLink" Opacity="0">
                <Hyperlink Foreground="White" RequestNavigate="Hyperlink_RequestNavigate" NavigateUri="http://webcast.codeplex.com">
                  <Run Text="http://webcast.codeplex.com"/>
                </Hyperlink>
            </TextBlock>
        </Border>

        <StackPanel Name="errorPanel" Grid.Row="2" Grid.RowSpan="3"
                    VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0">
            <StackPanel.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Path=LoadingError}" Value="true">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.5" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </StackPanel.Style>
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                <Image Height="32" Width="32" Margin="10,0" Source="..\Images\error.png"/>
                <TextBlock Foreground="White" TextTrimming="CharacterEllipsis" FontFamily="黑体"
			           FontSize="24" VerticalAlignment="Center" HorizontalAlignment="Center" FontStretch="ExtraExpanded" 
                       TextAlignment="Center" Text="无法连接网络，请检查网络连接或连接代理后重试！">
                    <TextBlock.BitmapEffect>
					    <OuterGlowBitmapEffect GlowColor="Black" GlowSize="5" Opacity=".5"/>
				    </TextBlock.BitmapEffect>
                </TextBlock>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0,30" HorizontalAlignment="Center">
                <Button x:Name="btnProxySetting" Margin="10,0" FontSize="16" FontFamily="黑体" Width="100" Command="{Binding Path=ProxySetting}">设置代理</Button>
                <Button x:Name="btnRetry" Margin="10,0" FontSize="16" FontFamily="黑体" Width="100" Command="{Binding Path=Retry}">重试</Button>
                <Button x:Name="btnContinue" Margin="10,0" FontSize="16" FontFamily="黑体" Width="100"
                        Visibility="{Binding Path=CanContinue, Converter ={StaticResource BooleanToVisibilityConverter}}" Command="{Binding Path=Continue}">继续</Button>
            </StackPanel>
        </StackPanel>
    </Grid>

    <UserControl.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard x:Name="OnLoaded_BeginStoryboard" Storyboard="{StaticResource OnLoaded}"/>
        </EventTrigger>
    </UserControl.Triggers>
</UserControl>